package com.gosophia.smsReceive.action;

import java.util.List;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.OrderCondition;
import com.gosophia.commons.Page;
import com.gosophia.commons.PropertyFilter;
import com.gosophia.commons.web.action.BaseSupportAction;
import com.gosophia.smsReceive.dto.SmsReceiveDTO;
import com.gosophia.smsReceive.ws.SmsReceiveWebService;

/**
 * 短信列表处理
 * 
 * @author tianchunyu
 */
@Controller("ListSmsReceiveAction")
@Scope("prototype")
public class ListSmsReceiveAction extends BaseSupportAction {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private static final Log logger = LogFactory
			.getLog(ListSmsReceiveAction.class);

	private Page<SmsReceiveDTO> smsPage;
	private List<PropertyFilter> propertyFilters;
	private List<OrderCondition> orderConditions;

	@Autowired
	private SmsReceiveWebService smsReceiveWebService;

	@Override
	public String _execute() throws Exception {
		// smsPage = smsReceiveWebService.findSmsReceiveByPage(
		// smsPage.getPageNo(), smsPage.getPageSize(), propertyFilters,
		// orderConditions);

		smsPage = smsReceiveWebService.findSmsReceiveByPage(1, 10,
				propertyFilters, orderConditions);
		logger.debug("成功执行列表方法，得到数据smsPage:" + smsPage);
		if(smsPage.getResult()!=null){
			logger.debug("列表长度为： " + smsPage.getResult().size());
		}else{
			logger.debug("列表长度为：0 ");
		}
		return SUCCESS;
	}

	public Page<SmsReceiveDTO> getSmsPage() {
		return smsPage;
	}

	public void setSmsPage(Page<SmsReceiveDTO> smsPage) {
		this.smsPage = smsPage;
	}

	public List<PropertyFilter> getPropertyFilters() {
		return propertyFilters;
	}

	public void setPropertyFilters(List<PropertyFilter> propertyFilters) {
		this.propertyFilters = propertyFilters;
	}

	public List<OrderCondition> getOrderConditions() {
		return orderConditions;
	}

	public void setOrderConditions(List<OrderCondition> orderConditions) {
		this.orderConditions = orderConditions;
	}

}
